using System;
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;

public class DOTweenScale : MonoBehaviour
{
    public Ease mCurEase;

    private void Start()
    {
        mCurEase = Ease.Flash;
        transform.DOScale(Vector3.one * 2, 1).SetEase(mCurEase).SetId<Tween>("scale");
        DOTween.Pause("scale");
    }

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            transform.DOScale(Vector3.one * 2, 2);
        }
        else if (Input.GetKeyDown(KeyCode.S))
        {
            transform.DOScale(Vector3.one * 2, 1).SetLoops(-1);
        }
        else if (Input.GetKeyDown(KeyCode.D))
        {
            if (DOTween.IsTweening("scale"))
            {
                Debug.Log("ID = scale，正在播放中");
            }
            transform.DOScale(Vector3.one * 2, 2).From().SetEase(Ease.OutBack);
        }
        else if (Input.GetKeyDown(KeyCode.F))
        {
            DOTween.Play("scale");
            DOTween.Restart("scale");
        }
    }
}
